#-*- coding:gbk -*-
'''
Created on 2012-7-23

@author: xxy
'''
import equip
import ConfigParser

class Weapon(equip.Equip):
    def __init__(self, name, config_file):
        equip.Equip.__init__(self, name, equip.EquipType.WEAPON)
        self.__loadConfig(config_file)
        
    def __loadConfig(self, config_file):
        config = ConfigParser.ConfigParser()
        config.read(config_file)
        self.m_physical_attack = config.get('WeaponInfo', 'physical_attack')
        self.m_magic_attack = config.get('WeaponInfo', 'magic_attack')
        self.m_attack_distance = config.get('WeaponInfo', 'attack_distance')
        self.m_price_sell = config.get('Price', 'sell')
        self.m_price_buy = config.get('Price', 'buy')